<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.wxtf.platform.plugins.user.*"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
	UserBean user = (UserBean) request.getSession().getAttribute("userBean");

	String _db = user.getDbType();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>" />
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>生育情况</title>
		

		<link type="text/css" rel="stylesheet" href="ligerUI/skins/Aqua/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/<%=user.getUserCss()%>/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/ligerui-icons.css" />
		<link type="text/css" rel="stylesheet" href="resource/css/style.css" />

		<script type="text/javascript" src="js/jquery/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="ligerUI/js/core/base.js"></script>
		<script type="text/javascript" src="ligerUI/js/ligerui.min.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<script type="text/javascript" src="js/amcharts/amcharts.js"></script>
		<script type="text/javascript" src="js/generateChart.js"></script>


<script type="text/javascript">
var _db = '<%=_db%>';

AmCharts.ready(function () {
	
	
	
	
});


function serch1(){
	_jsonObj.classname = "com.wxtf.platform.main.report.ChartAction";
	_jsonObj.methodname = "chart2";
	_jsonObj.logicdata = "[]";
	
	var chartType = $('input[name="chartType"]:checked').val();
	var year = $('#year').val();
	var quarter = $('#month').val();
	var str = '';
	$("[name='cons']:checked").each(function(){  
		str += $(this).val() + ',';
    });
    if(str == ''){
    	succMsgTip("请选择图形数据项");
    } else {
	    str = str.substr(0, str.length - 1);
    }
	
	_jsonObj.logicdata = '[{\"cons\":\"' + str + '\",\"year\":\"' + year + '\",\"quarter\":\"' + quarter + '\"}]';
	callserver(_jsonObj, function(data, textStatus){
		if('1'==chartType){
			creatChart(data,'chartdiv1');
		}else if('2'==chartType){
			creatChart2(data,'chartdiv1','人数');
		}
		
		succMsgTip('操作成功');
	}, function(data, textStatus){
		succMsgTip('操作失败');
		
	});
}

</script>
</head>
	<body>
		<table class="serTable">
			<tr>
				<td align="left">
					<div style="border-bottom: 1px solid #EBEBEB; font-weight:bold;height: 28px; line-height: 28px;margin: 0 0 5px;" >
						<img src="ligerUI/skins/icons/communication.gif"/>
						<span>生育情况</span>
					</div>
				</td>
			</tr>
			<tr>
				<td>季度：</td>
				<td style="text-align: left;">
					<select id="year">
						<option value="2011">2011</option>
						<option value="2012">2012</option>
						<option value="2013">2013</option>
						<option value="2014">2014</option>
						<option value="2015">2015</option>
						<option value="2016">2016</option>
						<option value="2017">2017</option>
						<option value="2018">2018</option>
						<option value="2019">2019</option>
						<option value="2020">2020</option>
					</select>年
				</td>
				<td style="text-align: left;">
					<select id="month">
						<option value="1">第一季度</option>
						<option value="2">第二季度</option>
						<option value="3">第三季度</option>
						<option value="4">第四季度</option>
					</select>
				</td>
				<td style="text-align: left;"><input class="btn2" value="生成图形" type="button" onclick="serch1();" /></td>
			</tr>
			<tr>
				<td>图表类型：</td>
				<td style="text-align: left;"><input type="radio" name="chartType" value="1" />饼图</td>
				<td style="text-align: left;"><input type="radio" name="chartType" value="2" checked="checked" />柱图</td>
			</tr>
			<tr>
				<td>图形数据项：</td>
				<td style="text-align: left;"><input type="checkbox" id="con1" name="cons" value="con1" checked="checked" />怀孕人数</td>
				<td style="text-align: left;"><input type="checkbox" id="con2" name="cons" value="con2" checked="checked" />等孕人数</td>
				<td style="text-align: left;"><input type="checkbox" id="con3" name="cons" value="con3" checked="checked" />计划内一胎</td>
				<td style="text-align: left;"><input type="checkbox" id="con4" name="cons" value="con4" checked="checked" />计划内二胎</td>
				<td style="text-align: left;"><input type="checkbox" id="con5" name="cons" value="con5" checked="checked" />本季出生婴儿</td>
				<td style="text-align: left;"><input type="checkbox" id="con6" name="cons" value="con6" checked="checked" />晚婚+晚育</td>
			</tr>
		</table>
		<div id="chartdiv1" style="width: 1000px; height: 400px;"></div>
		<script type="text/javascript">
			var date = new Date();
			var y = date.getYear() + 1900;
			var m = date.getMonth();
			$('#year').val(y);
			$('#month').val(Math.floor(m/3+1));
		</script>
	</body>
</html>










